/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: Dec 31, 2009
 * Time: 10:50:40 AM
 * To change this template use File | Settings | File Templates.
 */
import dk.brics.automaton.Automaton;
import java.util.List;
import java.util.Set;
import org.jdom.Element;

// Referenced classes of package dk.brics.dsd:
//            Regexp, Schema, Context

class ComplementRegexp extends Regexp
{

    ComplementRegexp(Element element, Schema schema)
    {
        exp = parseOne(element, schema);
    }

    public Element toXML(Context context)
    {
        return (new Element("complement", "http://www.brics.dk/DSD/2.0")).addContent(exp.toXML(context));
    }

    boolean match(String s, Context context)
    {
        return !exp.match(s, context);
    }

    Automaton toAutomaton(Context context)
    {
        return exp.toAutomaton(context).complement();
    }

    void addBoolexps(Context context, Set set)
    {
        exp.addBoolexps(context, set);
    }

    void getMentioned(Context context, Set set, List list)
    {
        exp.getMentioned(context, set, list);
    }

    Regexp exp;
}
